//支付宝支付
export class AliPayment {
  pay(payInfoObj) {
    const { backUrl, srcUrl, payUrl, origin, orderId, tradeId } = payInfoObj;
    return new Promise((resolve, reject) => {
      try {
        window.location.href = `${origin}/v1/goods/ali_pay?payUrl=${payUrl}&orderId=${orderId}&srcUrl=${srcUrl}&backUrl=${backUrl}&app_id=${window.APPID}&isNewOrderPath=1&trade_id=${tradeId}`;
        resolve();
      } catch (error) {
        reject(error);
      }
    });
  }
}

//吱口令
export class AliPayCommand {
  pay() {
    return new Promise((resolve) => {
      resolve();
    });
  }
}
